﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RentalCalcV7
{
    /// <summary>
    /// The rental class, 
    /// One Rental instance hold one Movie instance
    /// </summary>
    public class Rental
    {

        public Rental()
        {
        }

        /// <summary>
        /// Create a new instance of the Rental class
        /// </summary>
        /// <param name="movie"></param>
        /// <param name="daysRented"></param>
        public Rental(Movie movie, int daysRented)
        {
            RentedMovie = movie;
            DaysRented = daysRented;
        }

        /// <summary>
        /// Gets or sets the movie instance of the Rental object
        /// </summary>
        public Movie RentedMovie
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the date range the movie will be rented
        /// </summary>
        public int DaysRented
        {
            get;
            set;
        }

        /// <summary>
        /// Calculate the price of one rental
        /// </summary>
        /// <returns>the price</returns>
        public double GetCharge()
        {
            return this.RentedMovie.GetCharge(this.DaysRented);
        }

        /// <summary>
        /// Calculate the memeber points of one rental
        /// </summary>
        /// <returns>memeber points</returns>
        public int GetPoints()
        {
            return this.RentedMovie.GetPoints(this.DaysRented);
        }
    }
}
